package com.xu.cloud.common.desensitization;

import org.springframework.lang.Nullable;
import org.springframework.util.CollectionUtils;

import java.util.List;

/**
 * 脱敏规则自定义接口集合
 *
 * @author xuguan
 * @since 2025/3/5
 */
public class DesensitizationRuleCustomizers {

    @Nullable
    private final List<IDesensitizationRuleCustomizer> customizers;

    public DesensitizationRuleCustomizers(List<IDesensitizationRuleCustomizer> customizers) {
        this.customizers = customizers;
    }

    public void customize(IDeSensitizationRuleFactory factory) {
        if (!CollectionUtils.isEmpty(customizers)) {
            for (IDesensitizationRuleCustomizer customizer : customizers) {
                customizer.customize(factory);
            }
        }
    }
}
